package com.senthink.gl.business.userlog.enums;

import lombok.Getter;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 控制类型枚举类
 * @author yuanpeng@senthink.com
 * @data 2018-02-05 9:40
 */

@Getter
public enum LogControlTypeEnum {

    DEFAULT(0, "默认"),

    SWITCH(1, "开关"),

    BRIGHTNESS(2, "亮度"),

    COLOR_TEMP(3, "色温"),

    STATUS(4, "亮度色温");

    private Integer code;

    private String type;

    LogControlTypeEnum(Integer code, String type) {
        this.code = code;
        this.type = type;
    }

    private static final Map<Integer, String> pool = new ConcurrentHashMap<>();

    static {
        for (LogControlTypeEnum enums : LogControlTypeEnum.values()) {
            pool.put(enums.getCode(), enums.getType());
        }
    }

    public static String getType(Integer code) {
        return pool.get(code);
    }

}
